/* GUI CONVERTED from rescdel.p (converter v1.75) Sat Aug 12 23:08:49 2000 */
/* rescdel.p - Repetitive subcontract shipper delete/archive                 */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*F0PN*/ /*V8:ConvertMode=FullGUIReport                                      */
/*K1Q4*/ /*V8:WebEnabled=No                                                  */
/* REVISION: 7.3      LAST MODIFIED: 10/31/94   BY: WUG *GN77*               */
/* REVISION: 7.3      LAST MODIFIED: 03/03/95   BY: aed *G0JC*               */
/* REVISION: 8.5      LAST MODIFIED: 06/18/96   BY: taf *J0V0*               */
/* REVISION: 8.6      LAST MODIFIED: 04/09/97   BY: *K08N* Steve Goeke       */
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb               */



/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i "b+ "}

/*K08N*/ {gprun.i ""icshdel.p"" "(true, false)" }

/*K08N*/ /* Disable the entire routine, since all shipper delete/archive */
/*K08N*/ /* functionality is encompassed within the above call to icshdel.p. */

/*K08N*  define variable shipfrom like abs_shipfrom label "Ship-From Site".
 *K08N*  define variable shipfrom1 like abs_shipfrom label {t001.i}.
 *K08N*  define variable id like abs_id.
 *K08N*  define variable id1 like abs_id label {t001.i}.
 *K08N*  define variable sdate like abs_shp_date.
 *K08N*  define variable sdate1 like abs_shp_date label {t001.i}.
 *K08N*  define variable sel_conf like mfc_logical  label "Confirmed Shippers" init yes.
 *K08N*  define variable sel_unconf like mfc_logical  label "Unconfirmed Shippers".
 *K08N*  define variable filename as character format "x(12)" label "Archive File".
 *K08N*  define variable indent_id as character format "x(12)" label "ID".
 *K08N*  define variable disp_abs_id as character.
 *K08N*  define variable op like wr_op.
 *K08N*  define new shared variable rdelete like mfc_logical label "Delete".
 *K08N*  /*G0JC*/ define new shared variable archive like mfc_logical label "Archive" init no.
 *K08N*  define new shared frame c.
 *K08N*  define new shared stream history.
 *K08N*
 *K08N*  form
 *K08N*     shipfrom     colon 20
 *K08N*     shipfrom1    colon 40
 *K08N*     id           colon 20
 *K08N*     id1          colon 40
 *K08N*     sdate        colon 20
 *K08N*     sdate1       colon 40
 *K08N*     skip(1)
 *K08N*     sel_conf     colon 30
 *K08N*     sel_unconf   colon 30
 *K08N*     skip(1)
 *K08N*     rdelete      colon 30
 *K08N*     archive      colon 30
 *K08N*     filename     colon 30
 *K08N*  with frame a side-labels width 80 attr-space.
 *K08N*
 *K08N*  form
 *K08N*     skip(1)
 *K08N*     abs_shipfrom         colon 28 label "Ship-From Site"
 *K08N*     si_desc              at 45 no-label
 *K08N*     abs_id               colon 28 label "ID"
 *K08N*  with frame a1 side-labels width 80 attr-space.
 *K08N*
 *K08N*  form
 *K08N*     abs_shipto           colon 28 label "Ship-To"
 *K08N*     ad_name              at 45 no-label
 *K08N*     ad_line1             at 45 no-label
 *K08N*  with frame b side-labels width 80 attr-space.
 *K08N*
 *K08N*  form
 *K08N*     indent_id
 *K08N*     abs_order    column-label "Work Order ID"
 *K08N*     op           column-label "Operation"
 *K08N*     abs_item     column-label "Item Number"
 *K08N*     abs_qty      format "->,>>>,>>9.9<<<<<<<<"
 *K08N*     pt_um
 *K08N*     abs_site
 *K08N*     abs_loc
 *K08N*     abs_lotser
 *K08N*     abs_ref
 *K08N*  with frame c down width 132 no-box.
 *K08N*
 *K08N*  disp
 *K08N*  sel_conf
 *K08N*  sel_unconf
 *K08N*  rdelete
 *K08N*  /*G0JC*/ archive
 *K08N*  with frame a.
 *K08N*
 *K08N*  mainloop:
 *K08N*  repeat:
 *K08N*     output stream history close.
 *K08N*
 *K08N*     if shipfrom1 = hi_char then shipfrom1 = "".
 *K08N*     if id1 = hi_char then id1 = "".
 *K08N*     if sdate = low_date then sdate = ?.
 *K08N*     if sdate1 = hi_date then sdate1 = ?.
 *K08N*
 *K08N*     set
 *K08N*     shipfrom
 *K08N*     shipfrom1
 *K08N*     id
 *K08N*     id1
 *K08N*     sdate
 *K08N*     sdate1
 *K08N*     sel_conf
 *K08N*     sel_unconf
 *K08N*     rdelete
 *K08N*  /*G0JC*/ archive
 *K08N*     with frame a.
 *K08N*
 *K08N*     if rdelete then do:
 *K08N*        /*G0JC** update archive with frame a. */
 *K08N*        if archive then do:
 *K08N*           filename = string(today,"999999").
 *K08N*           filename = "sh" + substring(filename,5,2) +
 *K08N*           substring(filename,1,2)
 *K08N*           + substring(filename,3,2).
 *K08N*           filename = filename + ".hst".
 *K08N*           display filename with frame a.
 *K08N*           {mfmsg.i 51 1}
 *K08N*           /* archive files should be backed up and deleted from disk*/
 *K08N*           if search(filename) <> ? then do:
 *K08N*              {mfmsg03.i 52 2 filename """" """"}
 *K08N*              /* WARNING: <filename> exists, data will be appended*/
 *K08N*           end.
 *K08N*           output stream history to value(filename) append.
 *K08N*        end.
 *K08N*  /*G0JC*/     else do:
 *K08N*  /*G0JC*/        display "" @ filename with frame a.
 *K08N*  /*G0JC*/     end.
 *K08N*        end.
 *K08N*        else do:
 *K08N*  /*G0JC*/     display "" @ filename with frame a.
 *K08N*  /*G0JC*/     if archive then do:
 *K08N*  /*G0JC*/        {mfmsg.i 7739 3}
 *K08N*  /*G0JC*/        undo, retry.
 *K08N*  /*G0JC*/     end.
 *K08N*     end.
 *K08N*
 *K08N*     if shipfrom1 = "" then shipfrom1 = hi_char.
 *K08N*     if id1 = "" then id1 = hi_char.
 *K08N*     if sdate = ? then sdate = low_date.
 *K08N*     if sdate1 = ? then sdate1 = hi_date.
 *K08N*
 *K08N*  /*J0V0*/ /* CHECK ACCESS TO SITE */
 *K08N*  /*J0V0*/ {gprun.i ""gpsirvr.p"" "(input shipfrom,
 *K08N*                                    input shipfrom1,
 *K08N*                                    output return_int)"}
 *K08N*
 *K08N*  /*J0V0*/ if return_int = 0
 *K08N*  /*J0V0*/ then do:
 *K08N*  /*J0V0*/    next-prompt shipfrom.
 *K08N*  /*J0V0*/    undo, retry.
 *K08N*  /*J0V0*/ end.
 *K08N*
 *K08N*     /* SELECT PRINTER */
 *K08N*     {mfselprt.i "printer" 132}
 *K08N*     {mfphead.i}
 *K08N*
 *K08N*     for each abs_mstr exclusive-lock
 *K08N*     where abs_shipfrom >= shipfrom and abs_shipfrom <= shipfrom1
 *K08N*     and abs_id begins "s"
 *K08N*     and abs_type = "u"
 *K08N*     and substr(abs_id,2,50) >= id and substr(abs_id,2,50) <= id1
 *K08N*     and
 *K08N*     (
 *K08N*        (
 *K08N*           sel_conf
 *K08N*           and
 *K08N*           substr(abs_status,2,1) = "y"
 *K08N*           and
 *K08N*           abs_shp_date >= sdate
 *K08N*           and abs_shp_date <= sdate1
 *K08N*        )
 *K08N*        or
 *K08N*        (
 *K08N*           sel_unconf
 *K08N*           and
 *K08N*           substr(abs_status,2,1) = ""
 *K08N*        )
 *K08N*     ):
 *K08N*        find si_mstr where si_site = abs_shipfrom no-lock.
 *K08N*        find ad_mstr where ad_addr = abs_shipto no-lock no-error.
 *K08N*
 *K08N*        assign
 *K08N*        disp_abs_id = substr(abs_id,2,50).
 *K08N*
 *K08N*        disp
 *K08N*        abs_shipfrom
 *K08N*        si_desc
 *K08N*        disp_abs_id @ abs_id
 *K08N*        with frame a1.
 *K08N*
 *K08N*        disp
 *K08N*        abs_shipto
 *K08N*        ad_name      when (available ad_mstr)
 *K08N*        ad_line1     when (available ad_mstr)
 *K08N*        with frame b.
 *K08N*
 *K08N*        put skip(1).
 *K08N*
 *K08N*        {gprun.i ""rescdela.p"" "(input recid(abs_mstr), input 0)"}
 *K08N*     end.
 *K08N*
 *K08N*     output stream history close.
 *K08N*     {mfrtrail.i}
 *K08N*  end.
 *K08N*/
